package com.wf.demo.job.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.wf.demo.info.pojo.Device;
import lombok.Data;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @Auther: wf
 * @Date: 2019/12/11 14:38
 * @Description:
 */
@Data
@Entity
@Table(name = "onlineOfMonth")
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
public class TimeOfDevice {
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private  int id;
    //每月第一天20191101
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private LocalDate creatTime;
    //每月在线时间
    private  long onlineTimeOfMonth;
    @ManyToOne
    @JoinColumn(name = "did")
    private Device device;

}
